/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pl.put.dcs_modeler.wizards.listComputingObjects;

import java.util.List;
import javax.swing.JPanel;
import org.openide.WizardDescriptor;

public final class ListComputingObjectsVisualPanel1 extends JPanel
{

    /** Creates new form listComputingObjectsVisualPanel1 */
    public ListComputingObjectsVisualPanel1()
    {
        initComponents();
    }

    public void setComputingObjectComboList( List< String > list )
    {
        for ( String el : list )
        {
            this.objectsListCombo.addItem( el );
        }
    }

    @Override
    public String getName()
    {
        return "Computing Object List";
    }

    void readSettings( WizardDescriptor wizardDescriptor )
    {   
        setComputingObjectComboList( ( List )wizardDescriptor.getProperty( "computingObjectsList" ) );
    }

    void storeSettings( WizardDescriptor d )
    {
        d.putProperty( "selectedCO", ( String )this.objectsListCombo.getSelectedItem() );
        d.putProperty( "coName", this.coName.getText() );
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents()
    {

        jLabel1 = new javax.swing.JLabel();
        objectsListCombo = new javax.swing.JComboBox();
        coName = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();

        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ListComputingObjectsVisualPanel1.class, "ListComputingObjectsVisualPanel1.jLabel1.text")); // NOI18N

        coName.setText(org.openide.util.NbBundle.getMessage(ListComputingObjectsVisualPanel1.class, "ListComputingObjectsVisualPanel1.coName.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(ListComputingObjectsVisualPanel1.class, "ListComputingObjectsVisualPanel1.jLabel2.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(objectsListCombo, 0, 380, Short.MAX_VALUE)
                    .addComponent(coName, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(74, Short.MAX_VALUE)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(coName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(23, 23, 23)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(objectsListCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(123, 123, 123))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField coName;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JComboBox objectsListCombo;
    // End of variables declaration//GEN-END:variables
}

